<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/vue.js"></script>
    <script src="../js/jquery-3.6.0.js"></script>
    <script src="../element-ui/lib/index.js"></script>
    <link rel="stylesheet" href="../element-ui/lib/theme-chalk/index.css">
</head>
<body>
<!--1. 准备一个容器-->
<div id="app">
    <el-button icon="el-icon-check" @click="fun" type="primary">弹框</el-button>
    <el-dialog :visible.sync="flag" title="用户登录">
        <form action="#">
            <p>用户名:<input type="text" name="username"></p>
            <p>密码:<input type="password" name="upassword"></p>
            <button type="submit">提交</button>
        </form>
    </el-dialog>
</div>
<script>
    let vm = new Vue({
        el: "#app",
        data: {
            flag :false,
        },
        methods: {
            fun:function () {
                this.flag=true;
            }
        },
    });
</script>

</body>
</html>